package xyz.lwm.lazycat.utility.resource;

import xyz.lwm.lazycat.utility.StringUtil;

public enum Location {

    CLASSPATH {
        @Override
        public String toPattern(String path) {
            if (StringUtil.isBlank(path)) {
                return null;
            }
            if (path.startsWith("classpath:")) {
                return path;
            } else {
                return "classpath:" + path;
            }
        }
    },

    FILEPATH {
        @Override
        public String toPattern(String path) {
            if (StringUtil.isBlank(path)) {
                return null;
            }
            if (path.startsWith("file:")) {
                return path;
            } else {
                return "file:" + path;
            }
        }
    };

    public String toPattern(String path) {
        throw new AbstractMethodError("Not implemented");
    }

}
